package com.zFace.单例模式;

/**
 * 枚举法
 */
public class Demo04 {
	private Demo04() {
	}

	private enum Singleton {
		INSTANCE;

		private Demo04 singleton;

		Singleton() {
			singleton = new Demo04();
		}

		public Demo04 getInstance() {
			return singleton;
		}
	}

	public static Demo04 getInstance() {
		return Singleton.INSTANCE.getInstance();
	}
}
